package com.iwhalecloud.bss.kite.cucc.service.attr.linkhandler;

import com.alibaba.fastjson.JSONObject;
import com.iwhalecloud.bss.kite.common.util.KiteStringUtils;
import com.iwhalecloud.bss.kite.cucc.service.attr.handler.CircuitRentalScopeAttrHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.annotation.AttrHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.impl.AbstractAttrLinkageHandler;
import com.iwhalecloud.bss.kite.manager.inst.KiteAttr;
import com.iwhalecloud.bss.kite.manager.inst.KiteInst;
import com.iwhalecloud.bss.kite.service.attr.AttrData;
import org.springframework.stereotype.Service;

/**
 * Description:
 * File Name:CircuitRentalScopeAttrLinkHandler
 * Modification History:
 * Date             Author      Version     Description
 * ------------------------------------------------------------------
 * 2021-5-11 14:23   邱萌         1.0       1.0 Version
 **/
@Service
@AttrHandler(CircuitRentalScopeAttrHandler.class)
public class CircuitRentalScopeAttrLinkHandler extends AbstractAttrLinkageHandler<AttrData> {
    @Override
    public void handle(KiteAttr kiteAttr, KiteInst kiteInst, AttrData attrData) {
        String serviceOfferId =  attrData.getServiceOfferId();
        //如果是追单，电路租用范围不可编辑
        if (KiteStringUtils.equals("1014", serviceOfferId) && KiteStringUtils.equals(kiteAttr.getFieldName(), "2_0000004")) {
            kiteAttr.setIsEdit("F");
        }
    }

    @Override
    public void handleStyle(KiteAttr kiteAttr, KiteInst kiteInst, AttrData attrData) {

    }
}
